package com.neuedu.his.controller;

import com.neuedu.his.common.core.BaseController;
import com.neuedu.his.common.core.BaseService;
import com.neuedu.his.common.core.UnCRUDBaseController;
import com.neuedu.his.entity.Register;
import com.neuedu.his.service.DoctorService;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLDecoder;
import java.util.List;
import java.util.Map;

@WebServlet("/doctor/*")
public class DoctorController  extends UnCRUDBaseController {

    DoctorService doctorService = new DoctorService();

    //查询对应的 患者列表
    public List<Register> getRegistList(HttpServletRequest request , HttpServletResponse response){
        return doctorService.getRegistList(request);
    }

    /**
     * 存储患者的信息   主诉、现病史、疾病史
     * @param request
     * @param response
     * @return
     */
    public boolean  receivePatient(HttpServletRequest request , HttpServletResponse response){
        return doctorService.receivePatient(request);
    }

    /**
     * 检查申请 的保存
     * @param request
     * @param response
     * @return
     */
    public boolean  saveCheckAppy(HttpServletRequest request , HttpServletResponse response){
        return doctorService.saveCheckApply(request);
    }

    /**
     * 保存检验项目
     * @param request
     * @param response
     * @return
     */
    public boolean  saveInspectApply(HttpServletRequest request , HttpServletResponse response){
        return doctorService.saveInspectApply(request);
    }

    /**
     * 根据患者id查询已经申请的项目
     * @param request
     * @param response
     * @return
     */
    public Map queryApplyItem(HttpServletRequest request , HttpServletResponse response){
        return doctorService.queryApplyItem(request);
    }


    public static void main(String[] args) {
//        String parmstr = "%7B%22registId%22:6,%22checkItemIds%22:[1,2]%7D";
        String parmstr = "%7B%22registId%22:6,%22checkItemIds%22:%5B1,2%5D%7D";


        String json = URLDecoder.decode(parmstr);
        System.out.println("json = " + json);

    }

}
